<template>
  <div></div>
</template>

<script>
  import {take, map,mergeAll,mergeMap} from 'rxjs/operators'  //注意merge是静态的,mergeAll是实例主导的
  import {fromEvent, interval, merge,of,scheduled} from 'rxjs'

  /*
  *
*/
  export default {
    name: "merge-map-base",
    mounted() {
      const letters = of('a', 'b', 'c');
      const result = letters.pipe(
        mergeMap(x => interval(1000).pipe(map(i => x+i),take(5))), ///mergeMap = map + mergeAll ,a,b,c均开始无限内部观察,所以不会停,除非take(5)
      );
      result.subscribe(x => console.log(x));
    }
  }
</script>

<style scoped>

</style>
